﻿package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	import Box2D.Dynamics.*;
	import Box2D.Collision.*;
	import Box2D.Collision.Shapes.*;
	import Box2D.Common.Math.*;
	
	
	
	
	
	
	public class MainAppClass extends Sprite {
		private var borderWorld:b2AABB;
		private var gravity:b2Vec2;
		private var world:b2World;
		private var groundDefination:b2BodyDef;
		private var groundShapeDefination:b2PolygonShape;
		
		public function MainAppClass():void {
			this.borderWorld = new b2AABB();
			this.borderWorld.lowerBound.Set(-1000.0, -1000.0);
			this.borderWorld.upperBound.Set(1000.0, 1000.0);
			this.gravity = new b2Vec2(0.0, 10.0);
			this.world = new b2World(gravity, true);
			this.groundDefination = new b2BodyDef();
			this.groundDefination.position.Set(100/30, 100/30);
			this.groundShapeDefination = new b2PolygonShape();
			this.groundShapeDefination.SetAsBox((100/2)/30, (100/2)/30);
			groundBody = world.CreateBody(groundDefination);
			groundBody.CreateShape(groundShapeDefination);
			groundBody.SetMassFromShapes();
			groundShapeDefination.density = 1.0; 
		}
		
	}
}